﻿from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings

# 获取项目设置
settings = get_project_settings()

# 创建爬虫进程
process = CrawlerProcess(settings)

# 添加爬虫
process.crawl('books')

# 启动爬虫
process.start()